<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>个人注册</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
	<meta name="renderer" content="webkit">
	<meta name="description" content="钱江黑盒-专注于杭师钱江的校园闲置物品交易平台" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 
	<link rel="stylesheet" type="text/css" href="/css/reset.css">
	<link rel="stylesheet" type="text/css" href="/css/user/regist.css">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
</head>
<body>
	<script src="/js/common/utils.js" ></script>
	<script src="/js/common/md5.js" ></script>
	<script>
		let arr = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 
			'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k','l', 
			'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
			'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
			, 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
		let vc;
		function getImg() {
			let imgEle = document.querySelector('.form-verify img');
			imgEle.src = '/user/getVI.do?' + new Date().getTime();
		}
		function getVC() {
			ajax({
				url: '/user/getVC.do?' + new Date().getTime(),
				async: false,
				success: function(xhr) {
					let arg = JSON.parse(xhr.responseText);
					if(arg.code == 200 && arg.message == 'success') {
						vc = arg.data;
					}
				}
			});
		}
		function _change() {
			getImg();
			getVC();
			return false;
		}
		function setCheckField() {
			let cf = document.getElementById('cf');
			let cfArr = ['q', 'j', 'd', 'b'];
			let random1 = Math.floor(Math.random() * 5);
			let random2 = Math.floor(Math.random() * arr.length);
			cfArr.splice(random1, 0, arr[random2]);
			let value = hex_md5(cfArr.join(''));
			cf.value = value + random1 + arr[random2];
		}
		window.onload = function() {
			_change();
			setCheckField();
		}	
	</script>
	
	<style>
		#cf {
			display: none;
			opacity: 0;
			visibiliy: hidden;
		}
	</style>
	<div id="mask"></div>
	<!-- 头部 start -->
	<div class="header">
		<div class="header-content  w clearfix">
			<div class="header-l">
				<a href="/">
					<img src="/images/qb_logo3.png" alt="logo">
					<strong class="name">钱江黑盒</strong>
				</a>
				<strong class="welcom">欢迎注册</strong>
			</div>
			<div class="header-r">
				<div>
					<span>已有账号？</span>
					<a href="./login.html">请登录></a>
				</div>
			</div>
		</div>
	</div>
	<!-- 头部 end -->
	<!-- 注册部分 start -->
	<div class="container w">
		<div class="main clearfix">
			<div class="error-tip" id="errorTip"></div>
			<form onsubmit="return checkForm()">
				<div class="form-item">
					<span class="number">学号</span>
					<input type="text" id="sno" autocomplete="off" />
					<span class="correct"></span>
				</div>
				<div class="form-tip1 clearfix">
					<span class="tip" ></span>
				</div>
				<div class="form-item">
					<span class="number">密码</span>
					<input type="password" id="password1" oncopy="return false;" onpaste="return false;" oncut="return false;" />
					<span class="correct"></span>
					<div class="eye">
						<img id="eye1" src="/images/eye-close.png" alt="open" draggable="false" />
					</div>
				</div>
				<div class="form-tip2">
					<div>
						<span class="tip" id="tip1">不能包括空格</span>
						<span class="tip" id="tip2">长度为8-16个字符</span>
						<span class="tip" id="tip3">必须包含字母、数字、符号中至少2种</span>
					</div>
					<div>
						<span class="out-tip"></span>
					</div>
				</div>
				<div class="form-item">
					<span class="number">确认密码</span>
					<input type="password" id="password2" oncopy="return false;" onpaste="return false;" oncut="return false;" />
					<span class="correct"></span>
					<div class="eye">
						<img id="eye2" src="/images/eye-close.png" alt="open" draggable="false" />
					</div>
				</div>
				<div class="form-tip1 clearfix">
					<span class="tip" ></span>
				</div>
				<div class="form-item form-verify">
					<span class="number">请输入验证码</span>
					<input type="text" autocomplete="off"  id="verifyCode" oncopy="return false;" onpaste="return false;" oncut="return false;" />
					<img src="" alt="验证码图片">
					<a href="javascript:_change()">看不清，换一张</a>
					<span class="correct" style="display: none;"></span>
				</div>
				<div class="form-tip1 clearfix">
					<span class="tip" ></span>
				</div>
				<div class="form-item form-submit">
					<button type="submit" id="submit">注册</button>
				</div>
				<input type="hidden" id="md5Pwd" autocomplete="off" style="display: none;" />
				<input type="text" autocomplete="off" id="cf" />
				<input type="text" value="" autocomplete="off" style="display: none;opacity: 0;visibility: hidden;" />
			</form>
			<div class="agreement-wrap" id="agreement">
				<label>
					<img src="/images/checkbox_agree.png" alt="同意标志图" class="agree" style="display: inline-block;" />
					<img src="/images/checkbox_disagree.png" alt="不同意标志图" class="disagree" style="display: none;" />
					<span>我已阅读并同意相关服务条款和隐私政策&nbsp;</span>
				</label>
				<img src="/images/arrow_down_icon.png" alt="展开内容图标"  style="display: inline-block;"/>
				<img src="/images/arrow_up_icon.png" alt="隐藏内容图标" style="display: none;" />
				<div class="agreement-content">
					<a href="/page/platform/not_open.html">《钱江黑盒用户服务协议》</a>
					<a href="/page/platform/not_open.html">《钱江黑盒隐私政策》</a>
					<a href="/page/platform/not_open.html">《用户行为规范》</a>
					<a href="/page/platform/not_open.html">《商品发布条例》</a>
				</div>
				<span class="agreement-tip">请同意并阅读一下条款</span>
			</div>
		</div>
	</div>
	<!-- 注册部分 end -->
	<!-- 底部 start -->
	<div class="footer w">
		<div class="footer-h clearfix">
			<em>
				<a href="/page/platform/not_open.html">关于我们</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">联系我们</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">商家入驻</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">广告服务</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">手机黑盒</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">友情链接</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">销售联盟</a>
			</em>
			<span>|</span>
			<em>
				<a href="/page/platform/not_open.html">钱江黑盒社区</a>
			</em>
		</div>
		<div class="footer-b">
			<span>Copyright ©2020 TPL Association 版权所有</span>
		</div>
	</div>
	<!-- 底部 end -->
	<script src="/js/user/regist.js"></script>
	<script charset="UTF-8">
		function getParamValue(url, name) {
			// url：key1=value1&key2=value2
			let arr = url.split('&');
			let value;
			arr.some(item => {
				if(item.startsWith(name)) {
					value = decodeURI(item.substring(name.length + 1));
					return true;
				}
			});
			return value;
		}
		let url = window.location.search;
		url = url.substring(1);
		let snoValue = getParamValue(url, 'sno');
		let msg = getParamValue(url, 'msg');
		if(snoValue) {
			sno.value = snoValue;			
		}
		if(msg) {
			let errorTip = document.getElementById('errorTip');
			errorTip.style.display = 'block';
			errorTip.innerText = msg;
		}
	</script>
</body>
</qbml>